<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>CMD</title>
    <script src="./sea.js"></script>
  </head>
  <body>
    <script>
      // SeaJS 配置
      seajs.config({
        base: "./"
      });
      define("a", function (require, exports, module) {
        exports.add = function (a, b) {
          return a + b;
        };
      });
      define("b", function (require, exports, module) {
        var a = require("a");
        exports.calculate = function () {
          return a.add(1, 2);
        };
      });
      seajs.use(["b"], function (b) {
        console.log(b.calculate());
      });
    </script>
  </body>
</html>
